﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ArgusPCLib.Mathematics
{
	class VariableS<T> : Variable, IOperand where T:struct,IOperand
	{
		public VariableS(string name, T? value)
			:base(name, typeof(T))
		{
			if (value.HasValue)
				base.Value = value.Value;
		}

		public VariableS(string name)
			: this(name, null) { }

		public new T? Value
		{
			get { return (T?)base.Value; }
			set { base.Value = value; }
		}
		#region IOperand
		public static VariableS<T> Parse(string text, string format, IFormatProvider formatProvider)
		{
			throw new NotImplementedException();
		}

		public static bool TryParse(string text, string format, IFormatProvider formatProvider, out VariableS<T> value)
		{
			throw new NotImplementedException();
		}

		public static int PartialParse(string text, string format, IFormatProvider formatProvider, out VariableS<T> value)
		{
			throw new NotImplementedException();
		}

		public VariableS<T> GetDeepCopy()
		{
			return new VariableS<T>(this.Name, this.Value);
		}

		IOperand IOperand.GetDeepCopy() { return this.GetDeepCopy(); }
		#endregion
	}

	class VariableC<T> : Variable, IOperand where T:class, IOperand
	{
		public VariableC(string name, T value)
			: base(name, typeof(T), value) { }

		public VariableC(string name)
			: base(name, null) { }

		public new T Value
		{
			get { return (T)base.Value; }
			set { base.Value = value; }
		}
		#region IOperand
		public static VariableC<T> Parse(string text, string format, IFormatProvider formatProvider)
		{
			throw new NotImplementedException();
		}

		public static bool TryParse(string text, string format, IFormatProvider formatProvider, out VariableC<T> value)
		{
			throw new NotImplementedException();
		}

		public static int PartialParse(string text, string format, IFormatProvider formatProvider, out VariableC<T> value)
		{
			throw new NotImplementedException();
		}

		public VariableC<T> GetDeepCopy()
		{
			return new VariableC<T>(this.Name, this.Value);
		}

		IOperand IOperand.GetDeepCopy() { return this.GetDeepCopy(); }
		#endregion
	}
}
